﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wwtfly.BBS.Enums.Users;
using System.Security.Principal;
using Wwtfly.BBS.BackModels.Models.Users.Right;

namespace Wwtfly.BBS.BackModels.Models.Users
{
    /// <summary>
    /// 用户 实体信息
    /// </summary>
    [Serializable]
    public class UsersModel : IIdentity
    {

        #region 属性
        /// <summary>
        /// 编号
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// -用户名
        /// </summary>
        public string UserName { get; set; }
        /// <summary>
        /// -真实姓名
        /// </summary>
        public string TrueName { get; set; }
        /// <summary>
        /// -用户积分
        /// </summary>
        public decimal UserIntegral { get; set; }

        /// <summary>
        /// 用户密码
        /// </summary>
        public string UserPassword { get; set; }

        /// <summary>
        /// 用户邮箱
        /// </summary>
        public string UserEmail { get; set; }

        /// <summary>
        /// 是否 验证邮箱
        /// </summary>
        public bool UserEmailState { get; set; }
        /// <summary>
        /// 用户手机
        /// </summary>
        public string UserMobile { get; set; }
        /// <summary>
        /// 是否 用户手机
        /// </summary>
        public bool UserMobileState { get; set; }
        /// <summary>
        /// 用户ＱＱ
        /// </summary>
        public string UserQQ { get; set; }
        /// <summary>
        /// 用户ＭＳＮ
        /// </summary>
        public string UserMSN { get; set; }
        /// <summary>
        /// 用户彩币
        /// </summary>
        public decimal? UserColourMoney { get; set; }

        /// <summary>
        /// 用户金额
        /// </summary>
        public decimal? UserMoney { get; set; }
        /// <summary>
        /// 用户上一次登录时间
        /// </summary>
        public DateTime? UserLoginTime { get; set; }
        /// <summary>
        /// 用户注册时间
        /// </summary>
        public DateTime UserRegisterTime { get; set; }
        /// <summary>
        /// 用户修改时间
        /// </summary>
        public DateTime? UserUpdateTime { get; set; }
        /// <summary>
        /// 用户图片链接
        /// </summary>
        public string UserImgUrl { get; set; }

        /// <summary>
        /// 用户状态
        /// </summary>
        public UserStateEnum UserState { get; set; }



        /// <summary>
        /// 用户是否 登录
        /// </summary>
        public bool UserLoginState { get; set; }

        /// <summary>
        /// 用户备注
        /// </summary>
        public string UserRemark { get; set; }

        /// <summary>
        /// 创建用户
        /// </summary>
        public int CreateUser { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 最后修改用户
        /// </summary>
        public int LastModifyUser { get; set; }
        /// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime LastModifyTime { get; set; }
        #endregion



        public UsersModel()
        {
        }

        public UsersModel(string name)
        {
            this.UserName = name;
        }

        /// <summary>
        /// 验证方式
        /// </summary>
        public string AuthenticationType
        {
            get { return "BBSForms"; }
        }

        /// <summary>
        /// 验证是否通过
        /// </summary>
        public bool IsAuthenticated
        {
            get
            {
                return !string.IsNullOrEmpty(this.UserName);
            }
        }

        /// <summary>
        /// 名字
        /// </summary>
        public string Name
        {
            get { return this.UserName; }
        }


        #region


        /// <summary>
        /// 是否为超级角色
        /// </summary>
        public bool IsSuperMan { get; set; }


        /// <summary>
        /// 用户角色 集合
        /// </summary>
        public IList<UARoleInfoModel> UARoleInfoList { get; set; }

        /// <summary>
        /// 用户权限 集合
        /// </summary>
        public IDictionary<string, int> UARightInfoList { get; set; }
        #endregion
    }
}
